<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="jquery.js"></script>
 <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css" />
<style>
	#exams_homepage{
		width:80%;
		margin:0px auto;
	}
	@font-face{
		font-family:Gingersnaps;
		src:url('newfont.ttf');
	}
	#title{
		width:80%;
		background-color:red;
		margin:0px auto;
		background-color:rgba(30,144,255,0.6);
		margin-top:40px;
		border-radius:40px;
		padding:10px;
	}
	#title span{
		font-family:Gingersnaps;
		font-size:30pt;
		padding-left:18%;
	}
	#homepage{
		width:100%;
		height:600px;
	}
	body{
		margin:0px;
		padding:0px;
		background-image:url('comp.jpg');
	}
	#homepagecontent{
		margin-top:30px;
	}
	#top{
		width:100%;
		height:40px;
		background-color:rgba(0,0,0,0.5);
	}
	#signinform{
		position:absolute;
		right:10px;
		top:7px;
	}
	.signinfields{
		border:0px;
		border-radius:10px;
		padding-left:8px;
	}
	#login_result{
		background-color:white;
		color:red;
		margin-left:75px;
	}
</style>
<script>
	$(function(){
		$.post("homepagesub.php?seed="+Math.random(),{},function(data){
			$("#homepagecontent").html(data);
		});
		$("#login_username").focus(function(){
			$("#login_username").val("");
			$("#login_password").val("");
			$("#login_result").text("");
		});
		$("#login_password").focus(function(){
			$("#login_result").text("");
		});
		$("#login_button").click(function(){
			$.post("signin.php?seed="+Math.random(),{
				user:$("#login_username").val(),
				pwd:$("#login_password").val()
			},function(data){
				if($.trim(data)=="admin")
				{
					window.location.href = "http://localhost/test/miniproject/frontend/admin.html";				
				}
				else if($.trim(data)=="student")
				{
					window.location.href="http://localhost/test/miniproject/frontend/student.html";

				}
				else
				{
					$("#login_result").text("Sorry.Wrong Username or Password");
					$("#login_password").val("");
				}
			});
		});
	});
</script>
</head>
<body>
<section id="top">
	<section id="signinform">
		<input type="text" placeholder="Username" class="signinfields" id="login_username"></input>
		<input type="password" placeholder="Password" class="signinfields" id="login_password"></input>
		<button type="button" class="signinfields" id="login_button">Signin</button><br/><br/>
		<label id="login_result" class="resultlabel"></label>
	</section>
</section>
<section id="homepage">
	<header id="title">
		<span>Internal Placement Training  System</span>
	</header>
	<section id="homepagecontent">
	</section>
</section>

</body>
</html>
